package com.wlsk.license.dto;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * dto基类
 */
public class BaseDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @Override
    public String toString() {
        ObjectMapper mapper = new ObjectMapper();
        try {
            return mapper.writeValueAsString(this);
        } catch (Exception e) {
            return ToStringBuilder.reflectionToString(this);
        }
    }

}
